// Updater_MFCDlg.h : header file
//

#pragma once
#include "afxwin.h"
#include <vector>
#include "addon.h"
#include "Updater.h" 
#include "afxcmn.h"
#include "TreeCtrlEx.h"

// CUpdater_MFCDlg dialog
class CUpdater_MFCDlg : public CDialog
{
// Construction
public:
	CUpdater_MFCDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_UPDATER_MFC_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;
	CUpdater upd;
	void InsertAddon(CAddon *addon, int i);
	bool GetAddons();
	std::vector<DWORD> selected_addons;
	void CUpdater_MFCDlg::GetTreeCheck(HTREEITEM hParentNode);
	void CUpdater_MFCDlg::DownloadSelectedAddons();
	void CUpdater_MFCDlg::SetStatus(CString msg);
	void CUpdater_MFCDlg::ResolveAddonsDependency();
	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	
	afx_msg void OnBnClickedButtonManage();
	CString c_sitename;
	CComboBox c_sitenameCtrl;
	
	CTreeCtrlEx addonsTree;
	afx_msg void OnNMDblclkTreeAddons(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedOk();
	afx_msg void OnNMClickTreeAddons(NMHDR *pNMHDR, LRESULT *pResult);
protected:
	int mode;
public:
	afx_msg void OnBnClickedEditSites();
};
